ANativeWindow_setFrameRate

Sets the intended frame rate for this window.

On devices that are capable of running the display at different refresh rates, the system may choose a display refresh rate to better match this window's frame rate. Usage of this API won't introduce frame rate throttling, or affect other aspects of the application's frame production pipeline. However, because the system may change the display refresh rate, calls to this function may result in changes to Choreographer callback timings, and changes to the time interval at which the system releases buffers back to the application.

Note that this only has an effect for windows presented on the display. If this ANativeWindow is consumed by something other than the system compositor, e.g. a media codec, this call has no effect.

Available since API level 30.

\param frameRate The intended frame rate of this window, in frames per second. 0 is a special value that indicates the app will accept the system's choice for the display frame rate, which is the default behavior if this function isn't called. The frameRate param does <em>not</em> need to be a valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device that can only run the display at 60fps.

\param compatibility The frame rate compatibility of this window. The compatibility value may influence the system's choice of display refresh rate. See the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* values for more info.

\return 0 for success, -EINVAL if the window, frame rate, or compatibility value are invalid.

extern (C)
static if(__ANDROID_API__ >= 30)
int32_t
ANativeWindow_setFrameRate

Meta